package com.wzy.designpattern.behavioral.stategy;

/**
 * 描述
 * 创建人    Wzy
 * 创建时间: 2020-05-16  19:01
 */
public class Text {
    //    public static void main(String[] args) {
//        PromotionActivity promotionActivity = new PromotionActivity(new FanXianPromotionStrategy());
//        promotionActivity.executePromotionStrategy();
//        PromotionActivity promotionActivity1 = new PromotionActivity(new ManJianPromotionStrategy());
//        promotionActivity1.executePromotionStrategy();
//    }
//    public static void main(String[] args) {
//        PromotionActivity promotionActivity = null;
//        String key = "LIJIAN";
//        if ("LIJIAN".equals(key)) {
//            promotionActivity = new PromotionActivity(new LiJianPromotionStrategy());
//        } else if ("FANXIAN".equals(key)) {
//            promotionActivity = new PromotionActivity(new FanXianPromotionStrategy());
//        }
//        promotionActivity.executePromotionStrategy();
//    }
    public static void main(String[] args) {
        String promotionKey = "LIJIAN";
        PromotionActivity promotionActivity = new PromotionActivity(PromotionStrategyFactory.getPromotionStrategy(promotionKey));
        promotionActivity.executePromotionStrategy();
    }
}
